﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="eTruck.Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>车辆进出管理系统</title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="<%=Page.ResolveClientUrl("~/Styles/ss.gridview.css")%>"/>
    <link rel="stylesheet" type="text/css" href="<%=Page.ResolveClientUrl("~/Styles/themes/default/easyui.css")%>"/>
	<link rel="stylesheet" type="text/css" href="<%=Page.ResolveClientUrl("~/Styles/themes/icon.css")%>"/>
	<script type="text/javascript" src="<%=Page.ResolveClientUrl("~/Scripts/jquery.min.js")%>"></script>
	<script type="text/javascript" src="<%=Page.ResolveClientUrl("~/Scripts/jquery.easyui.min.js")%>"></script>
    <style type="text/css">
        .ss_login_name
        {
            text-align: right;
        }
    </style>
</head>
<body class="easyui-layout" id="bodydiv" style=" margin:0; padding:0" >
<script type="text/javascript">
    function Regeditsrc(src,center) {

        document.getElementById("mainFram").src = src;
        $('#bodydiv').layout('panel', 'center').panel({ title: center });
       
    }
    
</script>
<script type="text/javascript">
    $(function () {
        $('#dlg').dialog('close');
    });
    function showupdatepwd() {
        $('#dlg').dialog('open');
        $('#dlg').parent().appendTo($("form:first"));
    }

    function updatepassword() {
        //check password , not allow empty
        var oldpwd = $("#<%=txtOldPwd.ClientID %>");
        var newpwd = $("#<%=txtNewPwd.ClientID %>");
        var newpwd2 = $("#<%=txtNewPwd2.ClientID %>");
        if (oldpwd.val().length == 0) {
            alert("旧密码不允许为空");
            oldpwd.focus();
            return;
        }
        if (newpwd.val().length == 0) {
            alert("密码不允许为空");
            newpwd.focus();
            return;
        }
        if (newpwd2.val().length == 0) {
            alert("密码不允许为空");
            newpwd2.focus();
            return;
        }
        if (newpwd.val() != newpwd2.val()) {
            alert("两次输入密码不一致，请重新输入");
            newpwd2.focus();
            return;
        }
        //begin to update
        $('[id$=btnUpdate]').click();
    }
</script>
    <form id="form1" runat="server">
  
    <div data-options="region:'north',border:false" style="height:45px;background:#B3DFDA;padding:0PX">
            <div class="title" >
                <h2>
                    车辆进出管理系统
                </h2>
            </div>
            <div class="loginDisplay">
                 [ <asp:LinkButton ID="lbnLogout" runat="server" 
                     onclick="lbnLogout_Click">登出</asp:LinkButton> ]
                欢迎您<asp:Label ID="LoginName" runat="server" Text=""></asp:Label>
                 [ <input type="button" value="修改密码" onclick="showupdatepwd()" /> ]
                
            </div>
      
        </div>
        <div data-options="region:'west',split:true,title:'导航'" style="width:200px;padding:10px;" >
        
			
			<ul class="easyui-tree">
            <%if (ParentMenus != null)
              {
                  for (int i = 0; i < ParentMenus.Length; i++)
                  {%>
				<li data-options="state:'opened'">
					<span><%=ParentMenus[i] %></span>
					<ul>
                    <% for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                       {
                           if (ParentMenus[i] == ds.Tables[0].Rows[j][2].ToString())
                           {%>
						<li>
                        <div onclick="Regeditsrc('<%=ds.Tables[0].Rows[j][1].ToString()+"?Module="+ds.Tables[0].Rows[j][6].ToString() %>','<%=ParentMenus[i]+"->"+ds.Tables[0].Rows[j][0].ToString() %>')"
                        ><%=ds.Tables[0].Rows[j][0].ToString()%></div>
							
						</li>
						<%}
                       } %>
					</ul>
				</li>
				
                <%
                }
              } %>
				
				<li>帮助</li>
				<li>关于本系统</li>
			</ul>
		</div>
        <div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td align="center">
                        Copyright (c) 2014  Spring Story  Corporation. All rights reserved.
                        <div id="dlg" class="easyui-dialog" title="修改密码" style="width: 330px; 
                            height: 200px; padding: 10px">
                            <table style=" width:100%">
                                <tr>
                                    <td class="ss_login_name">
                                        旧密码:
                                    </td>
                                    <td class="ss_login_value">
                                        <asp:TextBox ID="txtOldPwd" runat="server" Width="200px" MaxLength="32" TextMode="Password"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="ss_login_name">
                                        新密码:
                                    </td>
                                    <td class="ss_login_value">
                                        <asp:TextBox ID="txtNewPwd" runat="server" Width="200px" MaxLength="32" TextMode="Password"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="ss_login_name">
                                        确认密码:
                                    </td>
                                    <td class="ss_login_value">
                                        <asp:TextBox ID="txtNewPwd2" runat="server" Width="200px" MaxLength="32" TextMode="Password"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                            <input type="button" id="btnSubmit" name="submit" value="修改" onclick="updatepassword()"/>
                            <asp:Button ID="btnCancelPwd" runat="server" Text="取消" OnClientClick=" $('#dlg').dialog('close')" />
                            <div style=" visibility:hidden;">
                                <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click"  />
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div data-options="region:'center',title:'欢迎光临'"  id="MainDiv" style=" margin:0; padding:0; border:0" >
            <iframe   marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" id="mainFram" name="mainFram"  src="Welcome.aspx"
              width="100%" height="99%" >  
             ></iframe>
        </div>
      
    </form>
</body>
</html>
